package etc.utils;


import com.dmz.test.etc.utils.ftp.FtpFile;

import java.util.List;

/**
 * @author lee
 */
public class FileUtil extends cn.hutool.core.io.FileUtil {

    public static boolean localExist(FtpFile file) {
        List<String> fileNames = listFileNames(file.getLocalPath());
        return fileNames.stream().anyMatch(fileName -> {
            if(fileName.startsWith(file.getFileName()) && fileName.endsWith(file.getEndWith())) {
                file.setFileName(fileName);
                return true;
            }else {
                return false;
            }
        });
    }
}
